﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace FgoDataCrawler.Message.LeaderBoard
{
    public class Group
    {
        [JsonProperty("score")]
        public string Score { get; set; }

        [JsonProperty("color")]
        public string Color { get; set; }

        [JsonProperty("servants")]
        public List<Servant> Servants { get; set; }

        [JsonIgnore]
        public double DecimalScore
        {
            get
            {
                double addition = 0;
                if (Score.Contains("+"))
                {
                    addition += 0.1;
                }
                double score = Double.Parse(Score.Replace("+", ""));
                return score + addition;
            }
        }
    }
}
